package com.neusoft.resturant.controller;


import com.neusoft.resturant.common.utils.PageResult;
import com.neusoft.resturant.common.utils.R;
import com.neusoft.resturant.common.utils.SecurityUtils;
import com.neusoft.resturant.entity.ResShop;
import com.neusoft.resturant.service.IResShopService;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 店铺Controller
 * 
 * @author lzx
 * @date 2023-09-27
 */
@RestController
@RequestMapping("/restaurant/shop")
public class ResShopController
{
    @Autowired
    private IResShopService resShopService;


    /**
     * 分页查询
     * @param resShop
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/list2")
    public R list2(ResShop resShop,Integer pageNum,Integer pageSize)
    {
        PageResult list = resShopService.selectResShopList2(resShop,pageNum,pageSize);
        return R.success(list);
    }

    /**
     * 查询店铺列表
     */
    @GetMapping("/list")
    public R list(ResShop resShop)
    {
        List<ResShop> list = resShopService.selectResShopList(resShop);
        return R.success(list);
    }
    /**
     * 获取店铺详细信息
     */
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id)
    {
        return R.success(resShopService.selectResShopById(id));
    }


}
